package com.bbs.elsearch.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "articles")
public class Articles {

    @Id
    private Long _id;

    @Field(type = FieldType.Keyword)
    private Long articleId;

    @Field(type = FieldType.Keyword)
    private String userId;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String articleTitle;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String articleContent;

    @Field(type = FieldType.Keyword)
    private String createTime;

    @Field(type = FieldType.Keyword)
    private Integer tagId;

    @Field(type = FieldType.Keyword)
    private Integer commecntsPerson;

    @Field(type = FieldType.Keyword)
    private Integer articleVisitors;

    @Field(type = FieldType.Keyword)
    private String updateTime;

}
